home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1991 April
/
1991-04.d64
/
beginner basic
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
49 lines
0 clr:rem copyright 1991 compute publications intl ltd - all rights reserved
10 printchr$(147):poke646,6:poke53280,1:poke53281,1:rem set up screen
20 dimnu$(22),d$(14):rem 22 is max. no. of names, 14 is digits in tel. number
30 f(1)=54272:f(2)=54273:f(3)=54279:f(4)=54280:rem voices 1 & 2 frequency
40 g=54276:h=54283:rem control for voices 1 and 2
50 vn=65:vf=64:rem vn turns on square wave, vf turns it off
60 forl=54272to54295:pokel,0:next:rem clear sound chip
70 poke54296,15:rem full volume
80 poke54275,8:poke54282,8:rem select square wave
90 poke54277,20:poke54284,20:rem attack and decay voices 1 and 2
100 poke54278,192:poke54285,192:rem sustain and release voices 1 and 2
110 rem next 6 lines assign two frequencies for each key; see article
120 forn=1to3:w(1,n)=170:w(2,n)=44:next:rem first freq for keys 1, 2 & 3
130 forn=4to6:w(1,n)=87:w(2,n)=49:next:rem first freq for keys 4, 5 & 6
140 forn=7to9:w(1,n)=153:w(2,n)=54:next:rem first freq for keys 7, 8 & 9
150 w(1,0)=77:w(2,0)=60:rem first freq for key 0
160 forn=1to7step3:w(3,n)=121:w(4,n)=77:next:rem second freq for keys 1, 4 & 7
170 forn=2to8step3:w(3,n)=156:w(4,n)=85:next:rem second freq for keys 2, 5 & 8
180 forn=3to9step3:w(3,n)=165:w(4,n)=94:next:rem second freq for keys 3, 6 & 9
190 w(3,0)=156:w(4,0)=85:rem second freq for key 0
200 printtab(30)"press
210 [153][163]30)"return
220 printtab(30)"to dial
230 [153]"":[141]350:[141]440
240 z[178]50:[143] length of tones
250 [161]a$:[139]a$[179][177]"on"[167][139]a$[179][177]""[167][139]a$[179][177][199](13)[167]250
260 [139]a$[178]"on"[176]a$[178]""[167][141]440:[137]250
270 n$[178]nu$(y)
280 [129]n[178]1[164][195](n$):d$(n)[178][202](n$,n,1):[143] read telephone number
290 [139]d$(n)[178]"-"[167][130]
300 [129]t[178]1[164]4:[151]f(t),w(t,([197](d$(n)))):[130]:[143] poke frequencies voices 1 & 2
310 [151]g,vn:[151]h,vn:[143] tones on
320 [129]t[178]1[164]z:[130]:[143] length of tones
330 [151]g,vf:[151]h,vf:[143] tones off
340 [130]:[137]250
350 [135]n$,nu$(c):[139]nu$(c)[178]"q"[167][142]
360 [153][166]3)n$[163]18)nu$(c)
370 c[178]c[170]1:[139]c[177]22[167][153]"no more than 22 names and numbers!":[128]
380 [137]350
390 [131]jim,111-1111: [143]* place your
400 [131]bill,222-2222:[143]* data on line
410 [131]mike,333-3333:[143]* 400 through
420 [131]dave,444-4444:[143]* line 421
430 [131]q,q:[143] don't change this line!
440 [151]214,y:[153]:[151]211,2:[153]" "
450 [139]a$[178]"on"[167]y[178]y[171]1:[139]y[179]0[167]y[178]0
460 [139]a$[178]""[167]y[178]y[170]1:[139]y[177]c[171]1[167]y[178]c[171]1
470 [151]214,y:[153]:[151]211,2:[153]"*":[142]